package com.baizw.cultivation.enums;

import cn.hutool.json.JSONUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.context.annotation.Description;

/**
 * 权限枚举
 *
 * @author 剧终1204
 * @version V1.0
 * @date 2020年06月10日 10:12
 */
@Getter
@AllArgsConstructor
@Description("权限枚举")
public enum PermissionEnum {
    /**
     * 新增
     */
    ADD_PER("add", "新增", true, 1),
    DELETE_PER("delete", "删除", true, 2),
    UPDATE_PER("update", "更新", true, 4),
    SELECT_PER("select", "查询", true, 8),
    IMPORT_PER("import", "导入", true, 16),
    EXPORT_PER("export", "导出", true, 32);

    private final String action;
    private final String describe;
    private final boolean check;
    @JsonIgnore
    private final int mark;

    @Override
    public String toString() {
        return JSONUtil.toJsonStr(this);
    }
}
